package com.qianfeng.wuyang.himalaya.adapter;

import android.support.v4.app.Fragment;
import android.support.v4.app.FragmentManager;
import android.support.v4.app.FragmentPagerAdapter;

import java.util.ArrayList;
import java.util.List;

/**
 * Created by wuyang on 2016/12/4.
 */

public class Fragment_PagerAdapter extends FragmentPagerAdapter {

  private List<Fragment> fragmentList;
    private List<String> list;

    public Fragment_PagerAdapter(FragmentManager fm, List<Fragment> fragmentList) {
        super(fm);
        this.fragmentList = fragmentList;
        list = new ArrayList<>();
        list.add("推荐");
        list.add("分类");
        list.add("广播");
        list.add("榜单");
        list.add("主播");
    }

    @Override
    public Fragment getItem(int position) {
        return fragmentList.get(position);
    }

    @Override
    public int getCount() {
        return fragmentList.size();
    }

    @Override
    public CharSequence getPageTitle(int position) {
        return list.get(position);
    }


}
